<html lang="zh-CN" style="font-size: 55.2px;" class="translated-ltr">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0">
    <meta name="full-screen" content="yes">
    <meta name="browsermode" content="application">
    <link rel="icon" href="favicon.ico">
    <title>Welcome Indeed Mall</title>
    <link rel="stylesheet" href="/statics/css/base.css">
    <link href="/statics/css/chunk-vendors.c3991080.css" rel="stylesheet">
    <link href="/statics/css/app.bad77f0c.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/statics/css/chunk-2051c780.843196d8.css">
    <link rel="stylesheet" href="/static/index/css/common.css">
    <script src="/static/jquery-3.5.0.min.js"></script>
    <script src="/static/layer/layer.js"></script>
</head>

<body>
    <style>
        #loadingContainer {
            position: fixed;
            width: 100%;
            height: 100%;
            z-index: 999999;
            background: #ffffff;
            display: none;
        }
    </style>
    <div id="loadingContainer" style="display: none;">
        <div style="display: flex;align-items: center;justify-content: center;height: 100%;"><span>
                <font style="vertical-align: inherit;">
                    <font style="vertical-align: inherit;">Loading</font>
                </font>
            </span></div>
    </div>
    <div id="app">
        <div data-v-23cab078="" id="address-form">
            <div data-v-653af513="" data-v-23cab078="" class="com-nav"><i data-v-653af513="" onclick="history.go(-1)"
                    class="leftIcon van-icon van-icon-arrow-left" style="font-size: 22px;">
                    
                </i>
                <div data-v-653af513="" class="title">
                    <font style="vertical-align: inherit;">
                        <font style="vertical-align: inherit;">Add address</font>
                    </font>
                </div>
            </div>
            <div data-v-23cab078="" class="form-contailer">
                <div data-v-23cab078="" class="cell-card">
                    <div data-v-23cab078="" class="van-cell-group">
                        <div data-v-23cab078="" class="van-cell van-field">
                            <div class="van-cell__title van-field__label" style="width: 1.3rem;"><span>
                                    full name
                                </span></div>
                            <div class="van-cell__value van-field__value">
                                <div class="van-field__body">
                                    {present name="user_info.address_name"}
                                    <input
                                        class="van-field__control" name="address_name" readOnly="true" value="{$user_info.address_name}" maxlength="100" step="" enterkeyhint="done" autocomplete="off" type="" class="uni-input-input">
                                    {else /}
                        <input name="address_name" placeholder="请输入收件人姓名" maxlength="100" step="" enterkeyhint="done" autocomplete="off" type="" class="field__control">
                        {/present}
                                </div>
                            </div>
                        </div>
                        <div data-v-23cab078="" class="van-cell van-field">
                            <div class="van-cell__title van-field__label" style="width: 1.3rem;"><span>
                                 Telephone number
                                </span></div>
                            <div class="van-cell__value van-field__value">
                                <div class="van-field__body">
                                     {present name="user_info.address_phone"}
                                    <input type="text"
                                        class="van-field__control" name="address_phone" readOnly="true" value="{$user_info.address_phone}" maxlength="11" step="" enterkeyhint="done" autocomplete="off" type="" class="uni-input-input">
                                    {else /}
                                    <input name="address_phone" placeholder="请输入电话号码" maxlength="11" step="" enterkeyhint="done" autocomplete="off" type="" class="van-field__control">
                        {/present}
                                </div>
                            </div>
                        </div>
                        <div data-v-23cab078="" class="van-cell van-field">
                            <div class="van-cell__title van-field__label" style="width: 1.3rem;"><span>
                                    Full address
                                </span></div>
                            <div class="van-cell__value van-field__value">
                                <div class="van-field__body">
                                        {present name="user_info.address_info"}
                    <textarea name="address_info" readOnly="true" maxlength="140" enterkeyhint="" class="van-field__control" style="overflow-y: auto;">{$user_info.address_info}</textarea>
                    {else /}
                    <textarea name="address_info" maxlength="140" enterkeyhint="" class="van-field__control" style="overflow-y: auto;" placeholder="Please enter the full address"></textarea>
                    {/present}
                                </div>
                            </div>
                        </div>
                        <!--<div data-v-23cab078="" class="van-cell van-field">-->
                        <!--    <div class="van-cell__title van-field__label" style="width: 1.3rem;"><span>-->
                        <!--            <font style="vertical-align: inherit;">-->
                        <!--                <font style="vertical-align: inherit;">邮政编码</font>-->
                        <!--            </font>-->
                        <!--        </span></div>-->
                        <!--    <div class="van-cell__value van-field__value">-->
                        <!--        <div class="van-field__body"><input type="text" placeholder="邮政编码"-->
                        <!--                class="van-field__control"></div>-->
                        <!--    </div>-->
                        <!--</div>-->
                    </div>
                </div>
                <!--<div data-v-23cab078="" class="cell-card">-->
                <!--    <div data-v-23cab078="" class="switch-field">-->
                <!--        <div data-v-23cab078="">-->
                <!--            设置为默认地址-->
                <!--        </div>-->
                <!--        <div data-v-23cab078="">-->
                <!--            <div data-v-23cab078="" role="switch" aria-checked="false" class="van-switch"-->
                <!--                style="font-size: 14px;">-->
                <!--                <div class="van-switch__node"></div>-->
                <!--            </div>-->
                <!--        </div>-->
                <!--    </div>-->
                <!--</div>-->
                {empty name="user_info.address_name"}
                <div data-v-23cab078="" class="btn" style="margin-bottom: 15px; margin-top: 30px;">
                    <font style="vertical-align: inherit;">
                        <font style="vertical-align: inherit;">preservation</font>
                    </font>
                </div>
                {/empty}
            </div>
        </div>
    </div>
</body>
<script>
  $(document).on("click", ".save", function () {
    var address_name = $("input[ name='address_name']").val();
    var address_phone = $("input[ name='address_phone']").val();
    var address_info = $("textarea[ name='address_info']").val();
    layer.load(2);
    $.ajax({
      url: "{:Url('address')}",
      type: "post",
      traditional: true,
      data: {address_name: address_name, address_phone: address_phone, address_info:address_info},
      success: function (e) {
        layer.closeAll('loading');
        if (e.code === 1) {
          layer.msg(e.msg, {
            time: 2000,
            end: function () {
              location.reload();
            }
          });
        } else {
          layer.msg(e.msg, function () {
            return false;
          });
        }
      },
    });
  });
</script>
</html>